<%--
  Created by IntelliJ IDEA.
  User: fire'ge
  Date: 2022/5/3
  Time: 0:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>留言板管理</title>
    <link rel="stylesheet" href="/TakeawaySystem/css/Show.css" type="text/css">
</head>
<body>

    <table id="name-label">
        <tr>
            <td align="center" colspan="4">你好！${user.username}
                <a href="../jsp/BusinessCenter.jsp">返回</a>  </td>
        </tr>
    </table>
    <table>
    <tr>
        <td id= "tableTopic">
            评 论 区
        </td>
    </tr>
    <form action="../user/addMsg" method="post">

    <tr>
        <td>
            <input type="hidden" name="replyId" value=0> <input type="hidden" name="shopId" value="${shopId}">
            <input type="text" name="comment" style="width:1000px;height:30px"> <input type="submit" value="发 表 评 论">
        </td>
    </tr>
    </form>

</table>
<c:if test="${msgBoards.size()>0}">
    <c:forEach begin="0" end="${msgBoards.size()-1}" var="i" >
        <table>
            <c:if test="${msgBoards[i].replyId!=0}">
                <tr>
                    <td id="reply">
                        回复:${replies[i].text}
                    </td>
                </tr>
            </c:if>
            <tr>
                <td>
                    用户名： ${users[i].username}:
                    <c:if test="${user.rightId==1}">(商家)</c:if>:<br>
                    ${msgBoards[i].text}
                </td>
            </tr>
            <form action="user/addMsg" method="post">
            <tr>
                <td>
                    <input type="hidden" name="replyId" value=${msgBoards[i].id}>
                    <input type="hidden" name="shopId" value="${shopId}">
                    <input type="text" name="comment" style="width:1000px;height:30px"> <input type="submit" value="回复">
                </td>
            </tr>
            </form>
            <form action="../business/deleteMsg">
            <tr>
                <td>
                    <input type="hidden" value="${msgBoards[i].id}" name="msgId" >
                    <input type="hidden" value="${shopId}" name="shopId" >
                    <input type="submit" value="删 除">
                </td>
            </tr>
            </form>
        </table>
    </c:forEach>
</c:if>
</body>
</html>
